package com.zz.sboot.swag.controller;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhr
 */
@Slf4j
@RestController
@RequestMapping("z")
public class Z {

    @ApiOperation(value = "t1 测试", notes = "")
    @GetMapping("t1")
    public String t1() {
        log.info("t1");
        return "{\"hello\":null}";
    }

    @ApiOperation(value = "t2 测试", notes = "")
    @ApiImplicitParam(name = "name", value = "name 名字", required = true, dataType = "String")
    @PostMapping("t2")
    public String t2(@RequestBody String name) {
        log.info("t2: " + name);
        return "{\"hello\":\""+ name +"\"}";
    }
}
